{{define "user/detail.html"}}
<!DOCTYPE html>
<html>
	<head>
        {{template "header"}}
	</head>

	<body>
		<div class="weadmin-nav">
            <span class="layui-breadcrumb">
                <a href="/welcome">首页</a>
                <a href="/admin/user/list">用户管理</a>
                <a><cite>用户详情</cite></a>
            </span>
		</div>
		<div class="weadmin-body layui-fluid ">
			<div class="layui-row layui-form-item layui-col-space10">
				<div class="layui-col-xs6">
					<div class="layui-row layui-col-space10">
						<div class="layui-col-xs4 layui-col-right layui-table-header">
							用户名:
						</div>
						<div class="layui-col-xs8">
							{{.user.username}}
						</div>
					</div>
				</div>

				<div class="layui-col-xs6">
					<div class="layui-row layui-col-space10">
						<div class="layui-col-xs4 layui-col-right layui-table-header">
							所属机构:
						</div>
						<div class="layui-col-xs8">
							{{.user.orgname}}
						</div>
					</div>
				</div>
			</div>

			<div class="layui-row layui-form-item layui-col-space10">
				<div class="layui-col-xs6">
					<div class="layui-row layui-col-space10">
						<div class="layui-col-xs4 layui-col-right layui-table-header">
							手机号:
						</div>
						<div class="layui-col-xs8">
							{{.user.phone}}
						</div>
					</div>
				</div>

				<div class="layui-col-xs6">
					<div class="layui-row layui-col-space10">
						<div class="layui-col-xs4 layui-col-right layui-table-header">
							用户状态:
						</div>
						<div class="layui-col-xs8">
							{{if eq .user.state "1"}}
							启用
							{{else}}
							禁用
							{{end}}
						</div>
					</div>
				</div>
			</div>

			<div class="layui-row layui-form-item layui-col-space10">
				<div class="layui-col-xs6">
					<div class="layui-row layui-col-space10">
						<div class="layui-col-xs4 layui-col-right layui-table-header">
							邮箱:
						</div>
						<div class="layui-col-xs8">
							{{.user.email}}
						</div>
					</div>
				</div>

				<div class="layui-col-xs6">
					<div class="layui-row layui-col-space10">
						<div class="layui-col-xs4 layui-col-right layui-table-header">
						性别:</div>
						<div class="layui-col-xs8">
							{{if eq "男" .user.gender}}
							<i class="layui-icon we-blue" title="{{.user.gender}}">&#xe662;</i>
							{{else}}
							<i class="layui-icon we-red" title="{{.user.gender}}">&#xe661;</i>
							{{end}}
						</div>
					</div>
				</div>
			</div>

			<div class="layui-row layui-form-item layui-col-space10">
				<div class="layui-col-xs6">
					<div class="layui-row layui-col-space10">
						<div class="layui-col-xs4 layui-col-right layui-table-header">
						注册时间:
						</div>
						<div class="layui-col-xs8">
							{{.user.created}}
						</div>
					</div>
				</div>

				<div class="layui-col-xs6">
					<div class="layui-row layui-col-space10">
						<div class="layui-col-xs4 layui-col-right layui-table-header">
						最后更新时间:</div>
						<div class="layui-col-xs8">
							{{.user.updated}}
						</div>
					</div>
				</div>
			</div>

			<div class="layui-row layui-form-item layui-col-space10">
				<div class="layui-col-xs12">
					<div class="layui-row layui-col-space10">
						<div class="layui-col-xs2 layui-col-right layui-table-header">
						分配角色:
						</div>
						<div class="layui-col-xs10">
							{{ range $k,$v := .roleList }}
								{{if eq $v.ischeck "1"}}
								<button class="layui-btn layui-btn-primary ">{{$v.rolename}}</button>
								{{end}}
							{{ end }}
						</div>
					</div>
				</div>
			</div>

			<div class="layui-row layui-form-item layui-col-space10">
				<div class="layui-col-xs12">
					<button class="layui-btn fr" lay-filter="close" lay-submit="">关闭</button>
				</div>
			</div>
		</div>
    </body>

    {{template "jsfile"}}
	<script type="text/javascript">
		layui.extend({
			admin: '/static/js/admin',
		});
		layui.use(['jquery', 'form','element', 'admin', 'carousel'], function() {
			var element = layui.element,
				$ = layui.jquery,
				carousel = layui.carousel,
				form = layui.form,
				admin = layui.admin;
			//建造实例
			carousel.render({
				elem: '.weadmin-shortcut'
				,width: '100%' //设置容器宽度
				,arrow: 'none' //始终显示箭头
				,trigger: 'hover'
				,autoplay:false
			});

			//监听提交
			form.on('submit(close)', function(data){
				var index = parent.layer.getFrameIndex(window.name);
				parent.layer.close(index);
			});
		});
	</script>

</html>
{{end}}